package com.zige.zige.operationgudie;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.zige.zige.R;
import com.zige.zige.activity.RegisterActivity;
import com.zige.zige.utils.SharedPreferencesUtils;

/**左右滑动操作引导
 * Created by Fei on 2016/3/15.
 */
public class SlidingAroundOperateDialog extends android.support.v4.app.DialogFragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
        View view = inflater.inflate(R.layout.dialog_videodtails_slidarount, container);
        getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        Window window = getDialog().getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        window.setGravity(Gravity.BOTTOM);
        window.setAttributes(lp);
        getDialog().show();
        SharedPreferencesUtils.saveValue(getActivity(),SharedPreferencesUtils.videodetails_operate_guide,true);
        getDialog().setCanceledOnTouchOutside(true);
        getDialog().setCancelable(true);
        LinearLayout lay_all = (LinearLayout) view.findViewById(R.id.lay_all);
        lay_all.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SharedPreferencesUtils.saveValue(getActivity(),SharedPreferencesUtils.videodetails_operate_guide,true);
                getDialog().dismiss();
            }
        });
        ImageView img_go_register = (ImageView) view.findViewById(R.id.img_go_register);
        img_go_register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                SharedPreferencesUtils.saveValue(getActivity(),SharedPreferencesUtils.videodetails_operate_guide,true);
            }
        });


        return view;

    }
}
